package com.lzc.config;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class CacheConfig {

    /**
     * caffeine 缓存
     * @return
     */
    @Bean
    public Cache<String, String> caffeine(){

        return Caffeine.newBuilder()
                .initialCapacity(10)
                .maximumSize(100)
                .recordStats()
                .build();

    }
}
